Why Open-Source?

A Little Story..

Once upon a time, there was a young, naive and yet brilliant, scientist, who had a thought..

..the young scientist then came across an intriguing paper about the discrepancy in the PK of an antifungal drug, called voriconazole, when administered to adults versus children https://link.springer.com/article/10.1007%2Fs40262-014-0181-y.

What Open-Source Offers:

  • Free accessibility
  • Easy communication
  • Transparency
  • Reproducibility

Example of open-source PBPK modeling and simulation software is PK-Sim/MoBi http://www.open-systems-pharmacology.org/


Why R?

  • Fun!

Let’s Start Coding..

1. PBPK Modeling and Simulation

a. mrgsolve

Elmokadem, Ahmed, Matthew M. Riggs, and Kyle T. Baron. 2019. “Quantitative Systems Pharmacology and Physiologically-Based Pharmacokinetic Modeling With Mrgsolve: A Hands-On Tutorial.” CPT: Pharmacometrics & Systems Pharmacology, October. https://doi.org/10.1002/psp4.12467.

b. Simple PBPK Model

Model structure

Equations

  • Non-eliminating compartment (Muscle)

\[\frac{dA_{mu}}{dt}=Q_{mu}(C_{art}-\frac{C_{mu}}{\frac{Kp_{mu}}{BP}})\]

  • Eliminating compartment (Liver):

\[\frac{dA_{li}}{dt}=Q_{li}(C_{art}-\frac{C_{li}}{\frac{Kp_{li}}{BP}})-Cl_{li}.f_{u}.\frac{C_{li}}{\frac{Kp_{li}}{BP}}\]

  • Arterial blood compartment:

\[\frac{dA_{art}}{dt}=Q_{lu}(\frac{C_{lu}}{\frac{Kp_{lu}}{BP}}-C_{art})\]

  • Venous blood compartment:

\[\frac{dA_{ven}}{dt}=\sum_{T\neq lu} (Q_T.\frac{C_T}{\frac{Kp_T}{BP}}) − Q_{lu}.C_{ven}\]

  • Lungs:

\[\frac{dA_{lu}}{dt}=Q_{lu}(C_{ven} − \frac{C_{lu}}{\frac{Kp_{lu}}{BP}})\]

Tasks

  1. Use ../model/simplePBPK.cpp file to build a simple PBPK model.

  2. Use script.R script to compile the model and run a simple simulation (chunks 1 and 2).


b. Voriconazole PBPK Model

References

Zane NR, Thakker DR. A physiologically based pharmacokinetic model for voriconazole disposition predicts intestinal first-pass metabolism in children. Clin Pharmacokinet. 2014;53: 1171–1182
https://link.springer.com/article/10.1007%2Fs40262-014-0181-y

ICRP Publication 89 http://www.icrp.org/publication.asp?id=ICRP%20Publication%2089

Utsey, Kiersten, Madeleine S. Gastonguay, Sean Russell, Reed Freling, Matthew M. Riggs, and Ahmed Elmokadem. 2020. “Quantification of the Impact of Partition Coefficient Prediction Methods on PBPK Model Output Using a Standardized Tissue Composition.” Drug Metabolism and Disposition: The Biological Fate of Chemicals, July. https://doi.org/10.1124/dmd.120.090498.

Model structure

Tasks

Note: for the following tasks use script.R chunks 3-?.

  1. Explore and compile typical adult male PBPK model ../model/voriPBPK.cpp

  2. Use calcKp_PT.R function to calculate voriconzole tissue:plasma partition coefficients according to Poulin and Theil method https://www.ncbi.nlm.nih.gov/pubmed/11782904.

  3. Simulate the steady state after a 4 mg/kg IV infusion dose of voriconazole given to an adult male with a rate of 4 mg/kg/h twice a day for 7 days. Compare the steady state plasma drug concentration-time profiles from previous simulation to the observed data in Adult_IV.csv. (N.B.: observed data were digitized from Zane and Thakker (2014) paper using WebPlotDigitizer https://automeris.io/WebPlotDigitizer/):

  1. Simulate the steady state after a 200 mg PO dose of voriconazole given to an adult male with a rate of twice a day for 7 days. Compare the steady state plasma drug concentration-time profile to the observed data in Adult_PO.csv.

  1. Integrate the model with an additional gut wall enterocyte compartment to account for intestinal clearance, intestinal transit and lumen solubility effects on absorption rate. Note: use about an intestinal clearance that is 30 times lower than hepatic clearance. Recompile and re-run the previous step. Any change!!

  1. Generate pediatric model

  2. Simulate the steady state after a 4 mg/kg voriconazole IV infusion dosing in a male child subject infused at a rate of 3 mg/kg/h twice a day for seven days. Compare the steady state to the observed data in Pediatric_IV.csv.

  1. Simulate the steady state after a 4 mg/kg voriconazole PO dosing in a male child subject twice a day for seven days. Compare to obsreved data in Pediatric_PO.csv Note: Include a similar 30-fold lower intestinal clearance than hepatic clearance.


2. Sensitivity Analysis

a. Local

Graphical

Run graphical sensitivity analysis for the muscle:plasma (Kpmu) and lung:plasma (Kplu) partition coefficients using adult IV data.

FME package

Use package FME (https://cran.r-project.org/web/packages/FME/index.html) to run local sensitivity analysis for the partition coefficient parameters Soetaert, Karline, and Thomas Petzoldt. 2010. “Inverse Modelling, Sensitivity and Monte Carlo Analysis in R Using Package FME.” Journal of Statistical Software, Articles 33 (3): 1–28. https://cran.r-project.org/web/packages/FME/vignettes/FME.pdf.
What is the most influential parameter?

##      value scale      L1      L2    Mean     Min     Max   N
## Kpad  9.89  9.89 0.00438 0.00510 6.6e-05 -0.0057 0.01191 121
## Kpbo  7.91  7.91 0.00860 0.00994 4.6e-04 -0.0114 0.02109 121
## Kpbr  7.35  7.35 0.00768 0.01049 1.8e-03 -0.0337 0.00753 121
## Kpgu  5.82  5.82 0.00295 0.00415 8.3e-04 -0.0151 0.00375 121
## Kphe  1.95  1.95 0.00072 0.00093 3.0e-04 -0.0041 0.00160 121
## Kpki  2.90  2.90 0.00074 0.00119 1.4e-04 -0.0062 0.00219 121
## Kpli  4.66  4.66 0.00572 0.00837 1.4e-03 -0.0306 0.00699 121
## Kplu  0.83  0.83 0.00029 0.00039 1.1e-04 -0.0013 0.00033 121
## Kpmu  2.94  2.94 0.03825 0.04353 5.3e-03 -0.0818 0.05433 121
## Kpsp  2.96  2.96 0.00037 0.00051 1.2e-04 -0.0020 0.00053 121

b. Global

Review sobol global sensitivity analysis from sensitivity package (https://cran.r-project.org/web/packages/sensitivity/index.html)
Zhang, X-Y, M. N. Trame, L. J. Lesko, and S. Schmidt. 2015. “Sobol Sensitivity Analysis: A Tool to Guide the Development and Evaluation of Systems Pharmacology Models.” CPT: Pharmacometrics & Systems Pharmacology 4 (2): 69–79. https://ascpt.onlinelibrary.wiley.com/doi/full/10.1002/psp4.6
Vignette: https://github.com/mrgsolve/gallery/blob/master/application/sobol.md


3. Parameter Estimation

Use package nloptr (https://cran.r-project.org/web/packages/nloptr/index.html) to optimize for most influential partition coefficient parameter and compare prediction before and after optimization to observed data.
For more background on optimization methods, check out Metrum’s open science course MI210 https://metrumrg.com/course/mi210-essentials-population-pk-pd-modeling-simulation/

## $par
## [1] -0.5709545 -2.0482820
## 
## $value
## [1] -8.181457
## 
## $iter
## [1] 52
## 
## $convergence
## [1] 4
## 
## $message
## [1] "NLOPT_XTOL_REACHED: Optimization stopped because xtol_rel or xtol_abs (above) was reached."
## $Kpmu
## [1] 0.5649859
## 
## $sigma
## [1] 0.1289563

Simulate a 4 mg/kg voriconazole IV infusion dosing in a male child subject infused at a rate of 3 mg/kg/h twice a day for seven days. Compare the steady state prediction before and after optimization to the observed data in Pediatric_IV.csv.


4. Population simulations

a. How to create a population?

Need to introduce interindividual variability to physiological parameters

Willmann, Stefan, Karsten Höhn, Andrea Edginton, Michael Sevestre, Juri Solodenko, Wolfgang Weiss, Jörg Lippert, and Walter Schmitt. 2007. “Development of a Physiology-Based Whole-Body Population Model for Assessing the Influence of Individual Variability on the Pharmacokinetics of Drugs.” Journal of Pharmacokinetics and Pharmacodynamics 34 (3): 401–31. https://pubmed.ncbi.nlm.nih.gov/17431751/

“NHANES - National Health and Nutrition Examination Survey Homepage.” 2018. July 26, 2018. http://www.cdc.gov/nchs/nhanes/.

Meyer, Michaela, Sebastian Schneckener, Bernd Ludewig, Lars Kuepfer, and Joerg Lippert. 2012. “Using Expression Data for Quantification of Active Processes in Physiologically Based Pharmacokinetic Modeling.” Drug Metabolism and Disposition: The Biological Fate of Chemicals 40 (5): 892–901. https://pubmed.ncbi.nlm.nih.gov/22293118/

b. Simulation

Simulate a simple voriconazole dosing scenario for a population of 100 individuals, 50 males and 50 females, with ages ranging between 20-80, weights ranging between 50-100 kg and heights between 1.5 and 1.9 m. Use population saved in file ../data/derived/popPars_100.rds

##    user  system elapsed 
##   6.031   0.011   6.051

c. Parallelization

Use the package future.apply to run the same population simulation over parallel cores. How long does it take compared to the single core simulation?

##    user  system elapsed 
##   0.196   0.005   4.113

Check out the mrgsim.parallel package vignette: https://github.com/kylebaron/mrgsim.parallel


5. Shiny - Interactive Document

Explore the simple shiny app saved as app.R